package top.canyue.word_range.pojo.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import top.canyue.word_range.pojo.vo.ReviewVo;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Review {
    /**
     * id
     */
    @TableId(value = "id",type = IdType.ASSIGN_UUID)
    private String id;
    /**
     * 用户ID
     */
    private String userId;
    /**
     * 单词
     */
    private String word;
    /**
     * 最近一次复习(学习)日期
     */
    private Date reviewDate;
    /**
     * 下次复习日期
     */
    private Date nextReviewDate;
    /**
     * 复习间隔
     */
    private Integer stage;



    public ReviewVo toVo() {
        ReviewVo reviewVo = new ReviewVo();
        reviewVo.setId(id);
        reviewVo.setUserId(userId);
        reviewVo.setWord(word);
        reviewVo.setReviewDate(reviewDate);
        reviewVo.setNextReviewDate(nextReviewDate);
        reviewVo.setStage(stage);
        return reviewVo;
    }
}

